package com.didispace;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;


// @EnableBinding(Sink.class)
// 在 @EnableBinding 注解中增加对 SinkSender 接口的指定，使 Spring Cloud Stream 能创建出对应的实例  p357
@EnableBinding(value = {MySink.class, MySource.class})
public class MySinkReceiver {

    private static Logger logger = LoggerFactory.getLogger(HelloApplication.class);

    @StreamListener(MySink.INPUT_1)
    public void receive1(Object payload) {
        logger.info("Received: " + payload);
    }

    @StreamListener(MySink.INPUT_2)
    public void receive2(Object payload) {
        logger.info("Received: " + payload);
    }

}
